{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "19dda391-ef5b-4d6b-b4ba-0c0233c37c88",
   "metadata": {
    "id": "YSPItBwWZQgO"
   },
   "source": [
    "# Function Calling"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5f209c88-7648-43ae-a298-7547dc5e7a63",
   "metadata": {},
   "source": [
    "### Housekeeping"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a621b684-4812-4a8b-b094-42821858feae",
   "metadata": {
    "height": 166
   },
   "outputs": [],
   "source": [
    "def afunction(arg1:int = 0, arg2:str = \"hello\", **kwargs)->int:\n",
    "    ''' this is a function definition\n",
    "        arg1 (int): an exemplary yet modest argument\n",
    "        arg2 (str): another nice argument\n",
    "        **kwargs : the rest of the rabble \n",
    "\n",
    "        returns arg1 incremented by one\n",
    "    '''\n",
    "    return(arg + 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6367f5be-bbe9-49c8-95c5-b891cf0b0b53",
   "metadata": {
    "height": 47
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "afunction\n",
      " this is a function definition\n",
      "        arg1 (int): an exemplary yet modest argument\n",
      "        arg2 (str): another nice argument\n",
      "        **kwargs : the rest of the rabble \n",
      "\n",
      "        returns arg1 incremented by one\n",
      "    \n"
     ]
    }
   ],
   "source": [
    "print(afunction.__name__)\n",
    "print(afunction.__doc__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0a8a45a6-fc1e-414d-90e0-d9475e8e5130",
   "metadata": {
    "height": 47
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(arg1: int = 0, arg2: str = 'hello', **kwargs) -> int\n"
     ]
    }
   ],
   "source": [
    "import inspect\n",
    "print(inspect.signature(afunction))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aa1a1ee7-90fa-4816-bf99-606e34e9dd8d",
   "metadata": {},
   "source": [
    "##### Building User Query\n",
    "> Note, the video shows how to access utils.py in Jupyter Notebook V7.   \n",
    "> You may be in Jupyter Notebook V6. To access it in this version, on the menu, choose File->Open. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "f819feaf-1f55-4550-8089-bb9e677ab68b",
   "metadata": {
    "height": 353
   },
   "outputs": [],
   "source": [
    "import inspect\n",
    "def build_raven_prompt(function_list, user_query):\n",
    "    raven_prompt = \"\"\n",
    "    for function in function_list:\n",
    "        signature = inspect.signature(function)\n",
    "        docstring = function.__doc__\n",
    "        prompt = \\\n",
    "f'''\n",
    "Function:\n",
    "def {function.__name__}{signature}\n",
    "    \"\"\"\n",
    "    {docstring.strip()}\n",
    "    \"\"\"\n",
    "    \n",
    "'''\n",
    "        raven_prompt += prompt\n",
    "        \n",
    "    raven_prompt += f\"User Query: {user_query}<human_end>\"\n",
    "    return raven_prompt\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "158f8a7e-d20f-464f-b3f0-e95c5fae5765",
   "metadata": {
    "height": 30
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Function:\n",
      "def afunction(arg1: int = 0, arg2: str = 'hello', **kwargs) -> int\n",
      "    \"\"\"\n",
      "    this is a function definition\n",
      "        arg1 (int): an exemplary yet modest argument\n",
      "        arg2 (str): another nice argument\n",
      "        **kwargs : the rest of the rabble \n",
      "\n",
      "        returns arg1 incremented by one\n",
      "    \"\"\"\n",
      "    \n",
      "User Query: a query<human_end>\n"
     ]
    }
   ],
   "source": [
    "print( build_raven_prompt([afunction], \"a query\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a0a64ddc-9c06-421e-935b-483985625692",
   "metadata": {
    "id": "6mX9gi3Ofj5r"
   },
   "source": [
    "### Concrete Example For Parallel Calls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "86a648f7-0733-4156-8e8b-5642cda45bf1",
   "metadata": {
    "height": 132
   },
   "outputs": [],
   "source": [
    "from utils import draw_clown_face\n",
    "\n",
    "raven_msg = \"Hey, can you build me two clowns.\" \\\n",
    "\"The first clown should be red faced, with a blue nose\" \\\n",
    "\"and a mouth from 0 to 180 degrees. The mouth should be black.\" \\\n",
    "\"The second clown should have a blue face and a green nose\" \\\n",
    "\"and a red mouth that's 180 to 360 degrees.\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9f5dbc18-dac3-43aa-af6e-286121405872",
   "metadata": {},
   "source": [
    "#### Building Raven Prompt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5630ea1c-7d71-46ff-9e88-59602ca4941d",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "height": 64,
    "id": "IThyr1tRfmey",
    "outputId": "79bc063a-3aef-4776-c71e-302e7e638121"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Function:\n",
      "def draw_clown_face(face_color='yellow', eye_color='black', nose_color='red', eye_size=0.05, mouth_size=(0.3, 0.1), mouth_color='black', eye_offset=(0.15, 0.15), mouth_theta=(200, 340))\n",
      "    \"\"\"\n",
      "    Draws a customizable, simplified clown face using matplotlib.\n",
      "\n",
      "    Parameters:\n",
      "    - face_color (str): Color of the clown's face. Default is 'yellow'.\n",
      "    - eye_color (str): Color of the clown's eyes. Default is 'black'.\n",
      "    - nose_color (str): Color of the clown's nose. Default is 'red'.\n",
      "    - eye_size (float): Radius of the clown's eyes. Default is 0.05.\n",
      "    - mouth_size (tuple): Width and height of the clown's mouth arc. Default is (0.3, 0.1).\n",
      "    - eye_offset (tuple): Horizontal and vertical offset for the eyes from the center. Default is (0.15, 0.15).\n",
      "    - mouth_theta (tuple): Starting and ending angles (in degrees) of the mouth arc. Default is (200, 340).\n",
      "\n",
      "    This function creates a plot displaying a simplified clown face, where essential facial features' size, position, and color can be customized. \n",
      "\n",
      "    Example usage:\n",
      "    draw_clown_face(face_color='lightblue', eye_color='green', nose_color='orange', \n",
      "                    eye_size=0.07, mouth_size=(0.4, 0.25), \n",
      "                    eye_offset=(0.2, 0.2), mouth_theta=(0, 180))\n",
      "\n",
      "    # This will draw a simplified clown face with a light blue face, green eyes, an orange nose, and a smiling mouth.\n",
      "    \"\"\"\n",
      "    \n",
      "User Query: Hey, can you build me two clowns.The first clown should be red faced, with a blue noseand a mouth from 0 to 180 degrees. The mouth should be black.The second clown should have a blue face and a green noseand a red mouth that's 180 to 360 degrees.<human_end>\n"
     ]
    }
   ],
   "source": [
    "raven_prompt = build_raven_prompt([draw_clown_face], raven_msg)\n",
    "\n",
    "print (raven_prompt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1e3e2db9-0696-4978-a42b-7e6038e00733",
   "metadata": {
    "height": 81
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "draw_clown_face(face_color='red', nose_color='blue', mouth_color='black', mouth_theta=(0, 180)); draw_clown_face(face_color='blue', nose_color='green', mouth_color='red', mouth_theta=(180, 360));\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAK4AAACuCAYAAACvDDbuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAReUlEQVR4nO2de5BU1Z3HP923G8OjVkTA4jGQBVMgDJAIUdSZMVvlAosKoQJSpgrQ5Z9FdrMYzOOPbNZsNIIkkV1BUpWgKxhHHi6LY8YhJmVwyIBQg8DAiKkdauW54sBoCkGmH2f/+HUv7ewMTD/uOffcOZ+qW9MD0/f3O/d8+9e/e87vnhNRSikcDsuImnbA4SgEJ1yHlTjhOqzECddhJU64DitxwnVYiROuw0qccB1W4oTrsBInXIeVOOE6rMQJ12ElTrgOK3HCdViJE67DSpxwHVbihOuwEidch5U44TqsxAnXYSVOuA4rccJ1WIkTrsNKYqYdCAXJJH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tucVPW3cQJtxQkk5Irnz4NFy7I79koGo+LGPv1g6FDZT8wJ86iccJ1WEm4JyAcocUJ12ElTrgOK3HCdViJE67DSpxwHVbihOuwEidch5U44TqsxAnXYSVOuA4rccJ1WIkTrsNKnHAdVuKE67ASJ1yHlTjhOqzECddhJU64DitxwnVYiROuw0qccB1W4oTrsJL/BXz+aIho9u1OAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAK4AAACuCAYAAACvDDbuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAARrElEQVR4nO2de5BU1Z3HP/fe7lFYND4IhJdUzWCJMCAiBpIwmk1tBUIUasoF5A/AWqvcRUzEkETKLfcfQUGTSGSQrFWYlVhBQJdCWBw2lTJIwsuAwABCkpkKj4FAENTl5fTj7B+/bmYYZqB7pvuce26fT9Wt6cf0/f3uPd8+/bvnd87vekophcNhGb5pBxyOjuCE67ASJ1yHlTjhOqzECddhJU64DitxwnVYiROuw0qccB1W4oTrsBInXIeVOOE6rMQJ12ElTrgOK3HCdViJE67DSpxwHVbihOuwEidch5U44TqsxAnXYSVOuA4rccJ1WEnMtANRIJmEEyfg2DE4e1aeJ5PyXiwmW7du0Ls39Owpzx2dw53CHEkkYP9+2LEDdu6E+no4cgSOH4czZyDXsiqeBzffDL16Qb9+UFEBw4fDiBEwaJATda54rpJN25w5A7W18Pvfw7ZtUFcHTU3yXjwuQi4ELfdVVgZDhsDIkTB6NIwdKyJ3XIkTbgvq62HtWli9WgSbTksPmP3Z10XWpu+LgKurYfx4KC/X60eYKXnhnjwJS5fCG2/AwYPyUw65//QXG98XX5SCO+6A6dPh0UehRw/TnpmlJIWrFGzeDIsXw6p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oAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from utils import query_raven\n",
    "raven_call = query_raven(raven_prompt)\n",
    "print (raven_call)\n",
    "exec(raven_call)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f8461ad6-82b1-4b1b-bec4-f17f684b85f5",
   "metadata": {},
   "source": [
    "### Using Multiple Functions!"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bbc15476-312c-423a-b62b-136855f7985c",
   "metadata": {},
   "source": [
    "#### Building The Prompt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "3068564c-d53a-43d8-91d5-5dba9ed17632",
   "metadata": {
    "height": 81,
    "tags": []
   },
   "outputs": [],
   "source": [
    "from utils import draw_clown_face, draw_tie\n",
    "raven_msg = \"Hey draw a tie?\"\n",
    "raven_prompt = build_raven_prompt\\\n",
    "    ([draw_clown_face, draw_tie], raven_msg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "e5bcc88e-5ad3-48a6-b933-fd7f75fd972a",
   "metadata": {
    "height": 30
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Function:\n",
      "def draw_clown_face(face_color='yellow', eye_color='black', nose_color='red', eye_size=0.05, mouth_size=(0.3, 0.1), mouth_color='black', eye_offset=(0.15, 0.15), mouth_theta=(200, 340))\n",
      "    \"\"\"\n",
      "    Draws a customizable, simplified clown face using matplotlib.\n",
      "\n",
      "    Parameters:\n",
      "    - face_color (str): Color of the clown's face. Default is 'yellow'.\n",
      "    - eye_color (str): Color of the clown's eyes. Default is 'black'.\n",
      "    - nose_color (str): Color of the clown's nose. Default is 'red'.\n",
      "    - eye_size (float): Radius of the clown's eyes. Default is 0.05.\n",
      "    - mouth_size (tuple): Width and height of the clown's mouth arc. Default is (0.3, 0.1).\n",
      "    - eye_offset (tuple): Horizontal and vertical offset for the eyes from the center. Default is (0.15, 0.15).\n",
      "    - mouth_theta (tuple): Starting and ending angles (in degrees) of the mouth arc. Default is (200, 340).\n",
      "\n",
      "    This function creates a plot displaying a simplified clown face, where essential facial features' size, position, and color can be customized. \n",
      "\n",
      "    Example usage:\n",
      "    draw_clown_face(face_color='lightblue', eye_color='green', nose_color='orange', \n",
      "                    eye_size=0.07, mouth_size=(0.4, 0.25), \n",
      "                    eye_offset=(0.2, 0.2), mouth_theta=(0, 180))\n",
      "\n",
      "    # This will draw a simplified clown face with a light blue face, green eyes, an orange nose, and a smiling mouth.\n",
      "    \"\"\"\n",
      "    \n",
      "\n",
      "Function:\n",
      "def draw_tie()\n",
      "    \"\"\"\n",
      "    Draws a tie\n",
      "    \"\"\"\n",
      "    \n",
      "User Query: Hey draw a tie?<human_end>\n"
     ]
    }
   ],
   "source": [
    "print(raven_prompt)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c424524-99d0-4c95-823f-d67298d2a42a",
   "metadata": {},
   "source": [
    "#### Getting The Call"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "b1416f63-e4e2-4018-b9b5-02d997754fde",
   "metadata": {
    "height": 47,
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "draw_tie()\n"
     ]
    }
   ],
   "source": [
    "raven_call = query_raven(raven_prompt)\n",
    "print (raven_call)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "049e2d91-ec3c-4554-ac5b-6bdaf54a00cc",
   "metadata": {
    "height": 30,
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGEAAACuCAYAAAAmuGPCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAFlUlEQVR4nO3dXU5bTRCE4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EUMSpkBQeIYIiToWkUI4iKeIUSAq9hEiKOAWSQiNEUsQpkBTGkQJFXDRJYZegQBEXTVJYBAWKuGiSQjhSooiLJCnkEpQo4iJJComgRBEXSdJ0jhQp4qJImn4JihRxUSRNj6BIERdF0lSOlCniIkiaegnKFHERJE2NoEwRF0HSNI4yUMTNJmnaJWSgiJtN0rQIGSjiZpM0haNMFHEzSZpyCZko4maSNCVCJoq4mSS5c5SRIm4WSe6XkJEibhZJ7hEyUsTNIsmVo8wUcTNIcr2EzBRxM0hyjZCZIm4GSW4cbYEizpskt0vYAkWcN0luEbZAEedNkgtHW6KI8yTJ5RK2RBHnSZJLhC1RxHmSZM7RFinivEgyv4QtUsR5kWQeYYsUcV4kmXK0ZYo4D5JML2HLFHEeJJlG2DJFnAdJZhztgSLOmiSzS9gDRZw1SWYR9kARZ02SCUd7ooizJMnkEvZEEWdJkkmEPVHEWZI0zNEeKeKsSBq+hD1SxFmRNBxhjxRxViQNcbRnijgLkoYuYc8UcRYkDUXYM0WcBUndHBVFHxslqfsSiqKPjZLUHaEo+tgoSV0cFUWfN0JS1yUURZ83QlJXhKLo80ZIWs1RUfT9eklafQlF0ffrJWl1hKLo+/WStIqjouj39ZC06hKKot/XQ9KqCEXR7+shaTFHRdHyrSVp8SUURcu3lqTFEYqi5VtL0mKO/vz5U5ewYqfTqb29vS367OIIh8Nh6FF73NK//Yf/YKNaa4uRF/jpkJtdXYLAKoLAKoLAKoLAKoLAKoLAKoLAKoLAKoLA/gMILoRVibsfewAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 100x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "exec(raven_call)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3378221-d823-4e30-891b-85d203ec7632",
   "metadata": {},
   "source": [
    "### Multiple Parallel Function Calling"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "588f02da-cdc5-4962-8347-b49af45ccc7d",
   "metadata": {},
   "source": [
    "#### Build The Prompt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "2b2a110d-f609-42ee-b429-9a5393816f84",
   "metadata": {
    "height": 30,
    "tags": []
   },
   "outputs": [],
   "source": [
    "raven_msg = \"Draw a clown and a tie?\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "4a36415a-f8e4-42d6-9e5d-03e462a103ef",
   "metadata": {
    "height": 47,
    "tags": []
   },
   "outputs": [],
   "source": [
    "raven_prompt = build_raven_prompt([draw_tie, draw_clown_face], raven_msg)\n",
    "raven_call = query_raven(raven_prompt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "48dc87c0-1e26-4ed0-b03a-16e03f6022ad",
   "metadata": {
    "height": 30,
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "draw_clown_face(face_color='yellow', eye_color='black', nose_color='red', eye_size=0.05, mouth_size=(0.3, 0.1), mouth_color='black', eye_offset=(0.15, 0.15), mouth_theta=(200, 340)); draw_tie()\n"
     ]
    }
   ],
   "source": [
    "print (raven_call)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "d67c74b1-38b4-4703-8f59-d0a96703b278",
   "metadata": {
    "height": 30,
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAK4AAACuCAYAAACvDDbuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAPL0lEQVR4nO2da4xV1RXHf/cxM4jEIFIMDI+IJSIwYgUftYIl0WqoQkhFwwfFxKTRqlRrX180bWqLYluJgjZGbFWi+MIASkE/gNL6LMKIg7QGJshLkIchiDgz9+5+WPd6h2FmvK+zH+euX3LCY+aevfbZ/7vuunutvXfCGGNQlMBIujZAUcpBh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KabiOsMWFvmM2Ep8TS4UQ2ChQlfGAB8ghyiE9VHnhgRSe7CekEULwQsXJI/+OnAvUgjiVzGIH+Sfy71IwYx/tQelEnio0JWPkONwmtE0cZ4EspL6aXwrTayEGHjczoxDThD5A+JhnJZXOSZFwcu+T5xEC7HzuJ35CMkErUMGsVa+vOX7Ogk55Shegs0TM4/bmXHIMupVFL6IxLi73/RtDNLnN4iraCHeI4nEd1cgMe+zFI6kj9MMRL4vw5A+bkT6HKc+nkiMQ4XuaAOeAuYjq4nThJu8yNs+Ftn5cjYu9/KyTY0JN49Bds5ZCDyP7GEWyuZ7+XNVr0Mq5i4i7t61O2pUuJ3ZByxCPPEWCtGTL0LubM9oxLPeBHzHmUU+oMI9jm3IcqGXkdmILPLx227ZjnybKeTExhnIahC7RzL5jAq3Rw4h387/DbyLbBnflvtZNcXc+V71wDnIKeSXAFcSo+PVq4oKt2g6kKKe9blrG3JM+h5kOX2xjzGBpFwHIzMBI4EJyPZTZ6Mp6+JQ4VaFDiRW3g0cyf0770XrEDH2A4YgRyupOCtFhasEScwTEEpcUeEqQaLCVYJEhasEiQpXCRIVrhIkKlwlSFS4SpCocJUgUeEqQaLCVYJEhasEiQpXCRIVrhIkKlwlSFS4SpCocJUgUeEqQaLCVYJEhasEiQpXCRIVrhIkKlwlSP4PnjIlsiSt2vUAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGEAAACuCAYAAAAmuGPCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAFlUlEQVR4nO3dXU5bTRCE4TGyWIIjVgjrsHfjhcBSEF4E9V18KpGIv3Nmuqerz+mSUG58McqbfhRFChwAoNVCdxf9gF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JYBAWKuGiSQjhSooiLJCnkEpQo4iJJComgRBEXSdJ0jhQp4qJImn4JihRxUSRNj6BIERdF0lSOlCniIkiaegnKFHERJE2NoEwRF0HSNI4yUMTNJmnaJWSgiJtN0rQIGSjiZpM0haNMFHEzSZpyCZko4maSNCVCJoq4mSS5c5SRIm4WSe6XkJEibhZJ7hEyUsTNIsmVo8wUcTNIcr2EzBRxM0hyjZCZIm4GSW4cbYEizpskt0vYAkWcN0luEbZAEedNkgtHW6KI8yTJ5RK2RBHnSZJLhC1RxHmSZM7RFinivEgyv4QtUsR5kWQeYYsUcV4kmXK0ZYo4D5JML2HLFHEeJJlG2DJFnAdJZhztgSLOmiSzS9gDRZw1SWYR9kARZ02SCUd7ooizJMnkEvZEEWdJkkmEPVHEWZI0zNEeKeKsSBq+hD1SxFmRNBxhjxRxViQNcbRnijgLkoYuYc8UcRYkDUXYM0WcBUndHBVFHxslqfsSiqKPjZLUHaEo+tgoSV0cFUWfN0JS1yUURZ83QlJXhKLo80ZIWs1RUfT9eklafQlF0ffrJWl1hKLo+/WStIqjouj39ZC06hKKot/XQ9KqCEXR7+shaTFHRdHyrSVp8SUURcu3lqTFEYqi5VtL0mKO/vz5U5ewYqfTqb29vS367OIIh8Nh6FF73NK//Yf/YKNaa4uRF/jpkJtdXYLAKoLAKoLAKoLAKoLAKoLAKoLAKoLAKoLA/gMILoRVibsfewAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 100x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "exec(raven_call)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "633894d1-9733-40e9-8d64-29f63db29b6c",
   "metadata": {},
   "source": [
    "### What is the significance of the docstrings?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "abdfd941-d837-4f4e-8a66-f95b52f0e500",
   "metadata": {
    "height": 98,
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "draw_clown_face(face_color='green')\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAK4AAACuCAYAAACvDDbuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAATNElEQVR4nO2deXBUVb6Av3O7O2NYDZLwWBIcUMMeZZEwBpdRQaOIgMLw5iHOs8Y3CK/EQZB5VVPFVOmw1SiWLI4WNSPoUwJPnsahgkv52AaQRQNJBBUEAmSSSDJh6zHdfe/746Y1Zgik033PvadzvqqusKTv73f7fn3612e7wrIsC41GMQy3E9BoWoMWV6MkWlyNkmhxNUqixdUoiRZXoyRaXI2SaHE1SqLF1SiJFlejJFpcjZJocTVKosXVKIkWV6MkWlyNkmhxNUqixdUoiRZXoyRaXI2SaHE1SqLF1SiJFlejJFpcjZL43U4gGQibYSrPV3L63GnO158nbIYJm2EA/IYfv+GnQ0oHenTsQbcO3fAb+mWPF/0KtpBQJERZdRn7Kvaxv2I/R2qPUF5XTsX5CmqDtVi0bF8VgSAtNY3uHbqT2TmTvml9Gdp9KMN7DGdA+gAtdQsReiebS1MbrKXoqyK2n9jO7lO7OVh1kPpIPQABI0DIDCUkTuNjpfhSGJwxmJE9R5KXlcc9191DWmpaQuIkG1rcRhypOULhF4VsPLSR7Se2Y1omfsP/3ce+LKIxDWGQl5XHhH4TeCD7Afqk9ZGah5dp8+JWXahi9f7VvFb8GofPHEYgAFr80e80hjCwLAsLi+xrspmeM53Hhj5GRvsMt1NzlTYprmVZ/LX8r6zYs4L1ZesxLRPTMt1Oq0UYwsAQBpMHTmbmiJmM6jUKIYTbaUmnTYlbH6lnTfEalu1aRml1qStlQKKI5j4wfSCzc2fzSM4jpPhS3E5LGm1CXNMyWVeyjvkfzedE3QkEwjOlQLxEz6V3594svHMhUwZNwRDJ3z2f1OJalsXmI5uZ+8FcS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lFWXse/0PvZV7ONo7VHKz5ZTca6CmmBNi3spBIIuqV3o3rE7mZ0y6ZPWh2HdhzG8x3D6p/dPuoECp9DiJoCwGabqQhWnz53mfP15wmaYUMRuRQO+AH7DT4eUDvTo2IOM9hlazgSgxdUoSfL3VGuSEi2uRkm0uBol0eJqlESLq1ESLa5GSbS4GiXR4mqURIurURItrkZJtLgaJdHiapREi6tREi2uRkm0uBol0eJqlESLq1ESLa5GSbS4GiXR4mqURIurURItrkZJtLgaJfl/GU744Lc/a04AAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "raven_msg = \"Draw me a sad one with green head\"\n",
    "raven_prompt = build_raven_prompt([draw_clown_face], raven_msg)\n",
    "raven_call = query_raven(raven_prompt)\n",
    "print (raven_call)\n",
    "exec(raven_call)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f05aa8d4-573f-4656-867b-b0cc0464e879",
   "metadata": {},
   "source": [
    "#### Fixing The Function Docstring"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "5eeadbcd-d63c-4a05-a442-7c616458be14",
   "metadata": {
    "height": 30,
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Function:\n",
      "def draw_clown_face(face_color='yellow', eye_color='black', nose_color='red', eye_size=0.05, mouth_size=(0.3, 0.1), mouth_color='black', eye_offset=(0.15, 0.15), mouth_theta=(200, 340))\n",
      "    \"\"\"\n",
      "    Draws a customizable, simplified clown face using matplotlib.\n",
      "\n",
      "    Parameters:\n",
      "    - face_color (str): Color of the clown's face. Default is 'yellow'.\n",
      "    - eye_color (str): Color of the clown's eyes. Default is 'black'.\n",
      "    - nose_color (str): Color of the clown's nose. Default is 'red'.\n",
      "    - eye_size (float): Radius of the clown's eyes. Default is 0.05.\n",
      "    - mouth_size (tuple): Width and height of the clown's mouth arc. Default is (0.3, 0.1).\n",
      "    - eye_offset (tuple): Horizontal and vertical offset for the eyes from the center. Default is (0.15, 0.15).\n",
      "    - mouth_theta (tuple): Starting and ending angles (in degrees) of the mouth arc. Default is (200, 340).\n",
      "\n",
      "    This function creates a plot displaying a simplified clown face, where essential facial features' size, position, and color can be customized. \n",
      "\n",
      "    Example usage:\n",
      "    draw_clown_face(face_color='lightblue', eye_color='green', nose_color='orange', \n",
      "                    eye_size=0.07, mouth_size=(0.4, 0.25), \n",
      "                    eye_offset=(0.2, 0.2), mouth_theta=(0, 180))\n",
      "\n",
      "    # This will draw a simplified clown face with a light blue face, green eyes, an orange nose, and a smiling mouth.\n",
      "    \"\"\"\n",
      "    \n",
      "User Query: Draw me a sad one with green head<human_end>\n"
     ]
    }
   ],
   "source": [
    "print (raven_prompt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "b62f8395-1b44-4ed2-856e-bc3b804bd951",
   "metadata": {
    "height": 489
   },
   "outputs": [],
   "source": [
    "raven_prompt_targeted = \\\n",
    "'''\n",
    "Function:\n",
    "def draw_clown_face(face_color='yellow', eye_color='black', nose_color='red', eye_size=0.05, mouth_size=(0.3, 0.1), mouth_color='black', eye_offset=(0.15, 0.15), mouth_theta=(200, 340))\n",
    "    \"\"\"\n",
    "    Draws a customizable, simplified clown face using matplotlib.\n",
    "\n",
    "    Parameters:\n",
    "    - face_color (str): Color of the clown's face. Default is 'yellow'.\n",
    "    - eye_color (str): Color of the clown's eyes. Default is 'black'.\n",
    "    - nose_color (str): Color of the clown's nose. Default is 'red'.\n",
    "    - eye_size (float): Radius of the clown's eyes. Default is 0.05.\n",
    "    - mouth_size (tuple): Width and height of the clown's mouth arc. Default is (0.3, 0.1).\n",
    "    - eye_offset (tuple): Horizontal and vertical offset for the eyes from the center. Default is (0.15, 0.15).\n",
    "    - mouth_theta (tuple): Controls the emotions of the clown. Starting and ending angles (in degrees) of the mouth arc. Default is (200, 340).\n",
    "\n",
    "    This function creates a plot displaying a simplified clown face, where essential facial features' size, position, and color can be customized. \n",
    "\n",
    "    Example usage:\n",
    "    draw_clown_face(face_color='lightblue', eye_color='green', nose_color='orange', \n",
    "                    eye_size=0.07, mouth_size=(0.4, 0.25), \n",
    "                    eye_offset=(0.2, 0.2), mouth_theta=(0, 180))\n",
    "\n",
    "    # This will draw a simplified clown face with a light blue face, green eyes, an orange nose, and a smiling mouth.\n",
    "    \"\"\"\n",
    "    \n",
    "User Query: Draw me a sad one with green head<human_end>\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "93c61030-f3f0-48f5-99a8-d96a95edc039",
   "metadata": {
    "height": 64
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "draw_clown_face(face_color='green', mouth_theta=[0, 180])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAK4AAACuCAYAAACvDDbuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAUAUlEQVR4nO2de3BV1b2Av7XPSTQ8TSThAiZ4QQyvgCIISEStVTSKFFGo9SK2Tm2V3pHWF71/0RktCNNqpzxaO9zWUK8SvOW2USZoO94ICIiggSQFeRQIEEkkueGVmnPO3vePlSNpSkjOY6+198n6ZjIEQvbvt8/+ztq/s15bOI7jYDD4DEt3AgZDPBhxDb7EiGvwJUZcgy8x4hp8iRHX4EuMuAZfYsQ1+BIjrsGXGHENvsSIa/AlRlyDLzHiGnyJEdfgS4y4Bl9ixDX4EiOuwZcYcQ2+xIhr8CVGXIMvMeIafIkR1+BLjLgGXxLUnUAqELbDnDx7khNnTnC25SxhO0zYDgMQtIIErSC90nsxsPdA+vfqT9AyL3uimFewi4QiIarrq9lZu5Ndtbs42HiQmqYaas/W0tjciEPX9lURCDIzMhnQawC5fXMZmjmUcQPGMX7geEZm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F6C6vpqi14vMCFsMREfENnxrg6f7aTvD1+KCHB6eVTKL8sPlpmzoBIHgtqtvY93sdZ4dEesq/qnGOyArI4v35r7HC197gaAV9NxkEC8QFPJ1eeFrL7Bx7kbfSwsp0OK2pbKukrl/mEvFyQrT+rYiEIztP5Y196/x3NTEREgpcQFCkRBLtyxlUfkiHMfptrVvQAQQQs6lfW7Kcyl3J0o5caNU1lXy5DtPsunoJgIi0G0Ejp7rzXk3s/KelSnVyrYlZcUF2ef77sF3eea9Z6isq8TC0rdzjstEz60gp4BldyzjzqF3+q5vNhZSWtwotmNTUlXCwj8v5EjTEQQiZWrg6LkM7juYJV9fwuxRs301AhYv3ULcKC2RFoorinll2ytU1VcRtIK+XVEczX1U9igWTFrAvLHztO7lpZpuJW4Ux3HYemwrK3asoKSqBNuxffPgQEtYWMJizqg5zJ8wn0lXTUrpkqAjuqW4bak7V8fqXasprihm76m9X91mvSJy23yGXzmcedfN47HrHyO7Z7bmzPTS7cVty6HGQ5TuK2X93vVsOroJ27FJs9II2RfbItw9ojEDIkBhXiEzh89kev505Y9k8jJG3A5obG6k7EAZW2q2sP34dnaf3E1LpAUgqTK3PVZ6IJ0x/ccwcdBECvMKueuau7ji8iuSEifVMOJ2kbAdprq+mp0ndrKzdieHGg9Rc7qG2jO1NDQ3dLmXQiDIyshiQO8B5PbJZUjmEG4YcAPjB45nRPaIlBsocAsjbhII22HqztVx4swJzracJWyHCUVkK5oWSCNoBemV3ouBvQeS0zPHyJkEjLgGX5L6PdWGlMSIa/AlRlyDLzHiGnyJEdfgS4y4Bl9ixDX4EiOuwZcYcQ2+xIhr8CVGXIMvMeIafIkR1+BLjLgGX2LENfgSI67BlxhxDb7EiGvwJUZcgy8x4hp8iRHX4EuMuAZfYsQ1+JL/B7GjIcxfTD+PAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "raven_call = query_raven(raven_prompt_targeted)\n",
    "print (raven_call)\n",
    "exec(raven_call)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "578ec52e-57dc-405f-9d9d-e5880367bdb7",
   "metadata": {
    "id": "yIK9qpfSacEE"
   },
   "source": [
    "### Concrete Example For Nested APIs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "975a5c18-2766-4380-a6b9-1b34f6799790",
   "metadata": {
    "height": 81,
    "tags": []
   },
   "outputs": [],
   "source": [
    "raven_msg_nested = \"Hey draw me a clown with \"\\\n",
    "                    \"a red face, blue eyes, green nose, \"\\\n",
    "                    \"and a black mouth open from 0 to 360 \"\\\n",
    "                    \"degrees?\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "b4a79fc5-b63c-43c4-976e-f3c4ff835e07",
   "metadata": {
    "height": 183,
    "id": "kcGq73hRYlwX"
   },
   "outputs": [],
   "source": [
    "from utils import draw_head, draw_eyes, \\\n",
    "    draw_nose, draw_mouth, \\\n",
    "    draw_clown_face_parts\n",
    "raven_function_nested = build_raven_prompt([draw_head, \\\n",
    "                                            draw_eyes, \\\n",
    "                                            draw_nose, \\\n",
    "                                            draw_mouth, \\\n",
    "                                            draw_clown_face_parts],\\\n",
    "                                            raven_msg_nested)\n",
    "raven_call = query_raven(raven_function_nested)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "9385d37d-61c3-4eaf-811f-ee2ea3290fe9",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "height": 30,
    "id": "AeAzs29PeHAl",
    "outputId": "26ea8920-96e5-4f16-905f-a7203c42be9a"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "draw_clown_face_parts(head=draw_head(face_color='red'), eyes=draw_eyes(eye_color='blue'), nose=draw_nose(nose_color='green'), mouth=draw_mouth(mouth_color='black', mouth_theta1=0, mouth_theta2=360))\n"
     ]
    }
   ],
   "source": [
    "print (raven_call)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "ffa9cffb-f2ed-4ae4-b6fc-0a61f39f2242",
   "metadata": {
    "height": 30,
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAK4AAACuCAYAAACvDDbuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAATCUlEQVR4nO2de5RUxZ3HP7cfIIgElEd4DOwBz2EcXooYMPLwj42wqJBZV5CcgK6c44agCYY8XDfu0Y1G0CQSHSDHHFCJMohuOIjBIf7hIgkPzYAwMMIfwy4MwwgiGIUBph+1f/y6mRFmYHqmb9WtO/U5557unum+v9+99e3qX1X9qspTSikcDsuImHbA4WgNTrgOK3HCdViJE67DSpxwHVbihOuwEidch5U44TqsxAnXYSVOuA4rccJ1WIkTrsNKnHAdVuKE67ASJ1yHlTjhOqzECddhJU64DitxwnVYiROuw0qccB1W4oTrsBInXIeVxEw7EAqSSTh6FI4cgVOn5HUyKf+LxeTo0gX69oXeveW1o024O9hSEgmorITyctixA6qqoLoaamvh5Elo6boqngfdu0OfPlBQAIMHw6hRMHo0FBU5UbcQz61k0wwnT0JZGfzlL7B9O1RUQH29/C8eFyHng8bn6tABhg+HMWNg3DiYPFlE7rgIJ9zGVFXB+vWwdq0INp2WGjD7s6+LrM1IRARcXAxTp8KgQXr9CDBOuMeOwfLl8MorsH+//JRDy3/6/SYSEV+UgiFD4N57Yc4c6NXLtGdGaZ/CVQq2bIElS+CNN6RmTadNe9UyIhE5pk+HefPg5psbvmztiPYl3Pp6WLkSFi+GvXvNhAH5Iuv70KEwfz7Mni0xcjuhfQg3nYbXX4dHHoFDh6SGCstlZ69l4EB4+mmYMUNq5JATbuEqBRs3wk9+Anv2SIHaEhLkSvbahg2DZ5+FSZNCHUKEV7gVFRIDbt4M0SikUqY90k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SYlqae8XI4DB6C6GmprZTp9S2+j58mQa58+0hMwaBDceCOMHi3ddm7IukU44eaDZFJi5SNH4NQpeZ2tReNxEWOXLtC3r+wH5sTZZpxwHVYS7gEIR2hxwnVYiROuw0qccB1W4oTrsBInXIeVOOE6rMQJ12ElTrgOK3HCdViJE67DSpxwHVbihOuwEidch5U44TqsxAnXYSVOuA4rccJ1WIkTrsNKnHAdVuKE67ASJ1yHlTjhOqzk/wFOALCUKT5h/gAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 200x200 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "exec(raven_call)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9b82a427-18bd-4c73-af08-b0932fe33596",
   "metadata": {
    "height": 30
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
